﻿using System;
using System.Collections.Generic;
using BizElements.Core;

namespace BizElements.BusinessLayer
{
    /// <summary>Builds journal table records.</summary>
    /// <typeparam name="TSourceEntity">Source table entity class.</typeparam>
    /// <typeparam name="TJournalEntity">Journal table entity class.</typeparam>
    public interface IJournalEntityBuilder<TSourceEntity, TJournalEntity>
        where TSourceEntity : IEntity, new()
        where TJournalEntity : IEntity, new()
    {
        /// <summary>Builds journal record for the specified source entity.</summary>
        /// <param name="entity">Entity whose properties will be journaled.</param>
        /// <returns>Journal table entity.</returns>
        TJournalEntity BuildJournalEntity(TSourceEntity entity);

        /// <summary>Builds journal record for the specified source entity.</summary>
        /// <param name="entities">Entities whose properties will be journaled.</param>
        /// <returns>Journal table entities.</returns>
        IEntityCollection BuildJournalEntityCollection(IEnumerable<TSourceEntity> entities);
    }
}
